function [option_price,conf_interval] = pricingOption(price_path,discount_factor ...
         ,initial_price,strike_price,target_price,reference_dates ...
         ,option,kind,conditions,equations)
    %Consider kind of option
    switch option
        case 'example'
            conditions{1} = 'price_path(i,reference_dates(1)) >= initial_price';
            conditions{2} = 'price_path(i,reference_dates(2)) >= initial_price';
            conditions{3} = 'price_path(i,reference_dates(3)) >= 0.5 * initial_price';
            equations{1} = '1.1 * initial_price;';
            equations{2} = '1.2 * initial_price;';
            equations{3} = '1.15 * initial_price;';
            equations{4} = '(price_path(i,reference_dates(3))/initial_price + 0.1) * initial_price;';
            DCF = estimateDCF(discount_factor,price_path,initial_price,strike_price,target_price,reference_dates,conditions,equations);
        case 'european'
            if strcmp(kind,'call')
                conditions{1} = 'price_path(i,reference_dates(1)) > strike_price';
                equations{1} = 'price_path(i,reference_dates(1)) - strike_price';
            else
                conditions{1} = 'price_path(i,reference_dates(1)) < strike_price';
                equations{1} = 'strike_price - price_path(i,reference_dates(1))';
            end
            equations{2} = '0';
            DCF = estimateDCF(discount_factor,price_path,initial_price,strike_price,target_price,reference_dates,conditions,equations);
        case 'american'
            if strcmp(kind,'call')
            	payoff = max(price_path - strike_price,0);
            else
             	payoff = max(strike_price - price_path,0);
            end
            DCF = discount_factor(end)*payoff(:,end);
            parfor i = 1:length(DCF)
                for j = 1:length(discount_factor)
                    if and(strcmp(kind,'call'),price_path(i,j) >= target_price)
                        DCF(i) = discount_factor(j)*payoff(i,j);
                        break
                    elseif and(strcmp(kind,'put'),price_path(i,j) <= target_price)
                        DCF(i) = discount_factor(j)*payoff(i,j);
                        break
                    end
                end
            end
        
%            define using the framework
%             reference_dates = (1:reference_dates(1));
%             if strcmp(kind,'call')
%                 for k = 1:length(reference_dates)-1
%                     conditions{k} = 'price_path(i,reference_dates(1)) > target_price';
%                     equations{k} = 'price_path(i,reference_dates(1)) - strike_price';
%                 end
%                 conditions{length(reference_dates)} = 'price_path(i,reference_dates(1)) > strike_price';
%                 equations{length(reference_dates)} = 'price_path(i,reference_dates(1)) - strike_price';
%             else
%              	for k = 1:length(reference_dates)-1
%                     conditions{k} = 'price_path(i,reference_dates(1)) < target_price';
%                     equations{k} = 'strike_price - price_path(i,reference_dates(1))';
%                 end
%                 conditions{length(reference_dates)} = 'price_path(i,reference_dates(1)) < strike_price';
%                 equations{length(reference_dates)} = 'strike_price - price_path(i,reference_dates(1))';
%             end
%             equations{length(reference_dates)+1} = '0';
        case 'asian'
            if strcmp(kind,'call')
                conditions{1} = 'mean(price_path(i,reference_dates(1))) > strike_price';
                equations{1} = 'mean(price_path(i,reference_dates(1))) - strike_price';
            else
                conditions{1} = 'mean(price_path(i,reference_dates(1))) < strike_price';
                equations{1} = 'strike_price - mean(price_path(i,reference_dates(1)))';
            end
            equations{2} = '0';    
            DCF = estimateDCF(discount_factor,price_path,initial_price,strike_price,target_price,reference_dates,conditions,equations);
        case 'self-defined'
            DCF = estimateDCF(discount_factor,price_path,initial_price,strike_price,target_price,reference_dates,conditions,equations);
    end
    alpha = 0.05;
    option_price = mean(DCF);
    conf_interval = estimateConfInt(option_price,DCF,alpha);

    